package pl.edu.agh.som.distance;

public class EuclideanDistance implements IDistanceFunction {

    @Override
    public double evaluate(double[] vector1, double[] vector2) {
        int len = vector1.length;
        double sum = 0.0;
        for (int i = 0; i < len; i++)
        {
            double diff = vector1[i] - vector2[i];
            sum += diff * diff;
        }

        return Math.sqrt(sum);
    }
}
